<?php
$type = isset($type)?$type:service_type::BANNER;
$dao = new DaoImage();
if($type==service_type::SLIDE):
	$images = $dao->getList(" typeID='{$type}'",3);
?>
<div id="slide"> 
	<ul id="slide-img" style="height:236px;">
	  <?php foreach($images as $img):?>
        <li style="display:none;">
			<a target="_blank" hidefocus="ture" href="<?php echo $img['url'];?>" title="<?php echo $img['title'];?>">
				<img class="slideImg"  src="<?php echo public_path($img['src']);?>" />
			</a>
		</li>
		<?php endforeach;?>
    </ul>
</div>
<?php else:
$image = $dao->getOne(" typeID='{$type}'");
?>
<img id="milo_banner" src="<?php echo public_path("{$image['src']}");?>" />
<?php endif;?>
<script type="text/javascript">
$(document).ready(function(){
	$("#slide-img img").LoadImage(true,900,236);
});
</script>
<script type="text/javascript">
$(document).ready(function(){
		var lis = $("#slide-img").find("li");
		var num = lis.length;
		var strA = "";
		var imgInter;
		var imgTimeout;
		var index = 0;
		$("#slide-img li").eq(index).fadeIn();
		setInterval(function(){
			index++;
			if(index>=num){
				index = 0;
			}else if(index<0){
				index = 0;
			}
			$("#slide-img li:visible").fadeOut(1000,function(){
				$("#slide-img li").eq(index).fadeIn(1000);
			});
		},6000);
});
</script>
